package com.platform.common;

import com.platform.common.mybatis.dialect.MySQLDialect;
import com.platform.common.util.SqlUtil;
import org.junit.Test;

import static org.junit.Assert.assertEquals;

/**
 * Created with IntelliJ IDEA.
 * User: wangyanginfo
 * Date: 12-9-12
 * Time: 下午5:07
 * To change this template use File | Settings | File Templates.
 */
public class SqlUtilUnit {

    @Test
    public void getCountString() {
        String sql = "select distinct count(1) AS rowCount from tb_user where a=1";
        MySQLDialect dialect = new MySQLDialect();
        String querySql = "select distinct * from tb_user where a=1";
        querySql = SqlUtil.getCountString(querySql);
        System.out.println(querySql);
        assertEquals("equals", sql, querySql);
    }

}
